package com.ruoyi.system.service.impl;

import com.ruoyi.system.domain.SysTable;
import com.ruoyi.system.mapper.StorageTypeStatMapper;
import com.ruoyi.system.mapper.SysTableMapper;
import com.ruoyi.system.service.SysTableService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class SysTableServiceImpl implements SysTableService {

    @Autowired
    private SysTableMapper sysTableMapper;

    @Override
    public List<SysTable> selectSysTableList(SysTable sysTable) {
        return sysTableMapper.selectSysTableInfoList(sysTable);
    }

    @Override
    public int deleteAll() {
        return sysTableMapper.deleteAll();
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public int insertSysTableInfo(SysTable sysTable) {
        sysTableMapper.deleteAll();
        return sysTableMapper.insertSysTableInfo(sysTable);
    }
}
